<!DOCTYPE html>

<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->

<head>

	<meta charset="utf-8" />

	<title>辽宁航空 | 锁定屏幕</title>

	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<!-- BEGIN GLOBAL MANDATORY STYLES -->

	<link href="../../assets/css/bootstrap/bootstrap.min.css" rel="stylesheet" type="text/css"/>

	<link href="../../assets/css/bootstrap/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>

	<link href="../../assets/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>

	<link href="../../assets/css/style-metro.css" rel="stylesheet" type="text/css"/>

	<link href="../../assets/css/style.css" rel="stylesheet" type="text/css"/>

	<link href="../../assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>

	<link href="../../assets/css/default.css" rel="stylesheet" type="text/css" id="style_color"/>

	<link href="../../assets/css/jquery/uniform.default.css" rel="stylesheet" type="text/css"/>

	<!-- END GLOBAL MANDATORY STYLES -->

	<!-- BEGIN PAGE LEVEL STYLES -->

	<link href="../../assets/css/system/lock.css" rel="stylesheet" type="text/css"/>

	<!-- END PAGE LEVEL STYLES -->

	<link rel="shortcut icon" href="../../assets/image/favicon.png" />

</head>

<!-- END HEAD -->

<!-- BEGIN BODY -->

<body>

	<div class="page-lock">

		<div class="page-logo">

			<a class="brand" href="index.html">

			<img src="../../assets/image/logo-big.png" alt="logo" />

			</a>

		</div>

		<div class="page-body">

			<img class="page-lock-img" alt="">

			<div class="page-lock-info">

				<h1></h1>

				<span class="email"></span>

				<span><em>已锁定</em></span>

				<form class="form-search">

					<div class="input-append">

						<input type="password" class="m-wrap password" placeholder="密码">

						<button type="button" class="btn blue icn-only submit"><i class="m-icon-swapright m-icon-white"></i></button>
						<div class="relogin">
							<p class="login-msg" style="font-size: 14px;color: #e1e1e1" href="javascript:;"></p>
						</div>

					</div>


				</form>

			</div>

		</div>

		<div class="page-footer">

			2013 &copy; Metronic. Admin Dashboard Template.

		</div>

	</div>

	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->

	<!-- BEGIN CORE PLUGINS -->

	<script src="../../assets/js/plug/jquery/jquery-1.10.1.min.js" type="text/javascript"></script>

	<script src="../../assets/js/plug/jquery/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>

	<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->

	<script src="../../assets/js/plug/jquery/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>

	<script src="../../assets/js/plug/bootstrap/bootstrap.min.js" type="text/javascript"></script>

	<!--[if lt IE 9]>

	<script src="../../assets/js/temp/excanvas.min.js"></script>

	<script src="../../assets/js/temp/respond.min.js"></script>

	<![endif]-->

	<script src="assets/js/plug/jquery/jquery.slimscroll.min.js" type="text/javascript"></script>

	<script src="../../assets/js/plug/jquery/jquery.blockui.min.js" type="text/javascript"></script>

	<script src="../../assets/js/plug/jquery/jquery.cookie.min.js" type="text/javascript"></script>

	<script src="../../assets/js/plug/jquery/jquery.uniform.min.js" type="text/javascript" ></script>

	<!-- END CORE PLUGINS -->

	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script src="../../assets/js/plug/jquery/jquery.backstretch.min.js" type="text/javascript"></script>


	<script>
		jQuery(document).ready(function() {
            var user = JSON.parse(sessionStorage.getItem("currentUserInfo"));
            var $input = $(".password");
            var $loginBtn = $(".submit");
            $(".page-lock-info h1").empty().append(user.loginName);
            $(".page-lock-info .email").empty().append(user.email);
            $(".page-lock-img").attr("src","http://localhost:8080/SSM_lnAirlines/upload" + user.pic);

            $loginBtn.on("click",function () {
                console.log($input.val());
                if($.trim($input.val()) === "") {
                    $(".login-msg").empty().append("密码不能为空！");
                    return;
				}
				$.ajax({
					url : "http://localhost:8080/SSM_lnAirlines/user/password",
					type : "post",
					data : $input.val(),
					dataType : "json",
                    headers: {
                        "Content-Type": "application/json; charset=utf-8"
                    },
					success : function (response) {
						if(response.data === true) {
                            window.location.href = "index.html";
						} else {
                            $(".login-msg").empty().append("密码错误，请重新输入！");
                            sessionStorage.removeItem("locked");
						}
                    },
					error : function (response) {
                        $(".login-msg").empty().append("服务器错误，请稍后重试！");
                    }
				});
            });

            $(document).on("keypress",function (e) {
				if(e.keyCode === 13) {
                    $loginBtn.trigger("click");
				}
            })

        });

	</script>

	<!-- END JAVASCRIPTS -->

</body>

<!-- END BODY -->

</html>